﻿<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="AddTestStructure.aspx.cs"
    Inherits="IDML.Web.Modules.Admin.AddTestStructure" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <fieldset>
        <legend>Test Structure</legend>
            <asp:UpdatePanel ID="UpdatePanel3" runat="server">
            <ContentTemplate>

        <ol>
            <li>
                <asp:Label ID="lblTest" runat="server" AssociatedControlID="ddlTest">Test</asp:Label>
                <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                    <ContentTemplate>
                        <asp:DropDownList ID="ddlTest" runat="server" 
                            onselectedindexchanged="ddlTest_SelectedIndexChanged" AutoPostBack="true">
                              <asp:ListItem Value="0" Text="-Select-" />
                            <asp:ListItem Value="1" Text="Test1" />
                            <asp:ListItem Value="2" Text="Test2" />
                            <asp:ListItem Value="3" Text="Test3" />
                        </asp:DropDownList>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </li>
            <li>
                <asp:Label ID="lblControl" runat="server" AssociatedControlID="ddlControl">Control</asp:Label>
                <asp:DropDownList ID="ddlControl" runat="server" OnSelectedIndexChanged="ddlControl_SelectedIndexChanged"
                    AutoPostBack="true">
                    <asp:ListItem Value="1" Text="TextBox" />
                    <asp:ListItem Value="2" Text="DropDownList" />
                    <asp:ListItem Value="3" Text="ComputationalField" />
                </asp:DropDownList>
            </li>
            <li>
                <asp:Label ID="Label1" runat="server">Lable name</asp:Label>
                <asp:TextBox ID="txtLableName" runat="server"></asp:TextBox>
            </li>
            <li>
                <asp:Label ID="Label3" runat="server">Unit</asp:Label>
                <asp:TextBox ID="txtUnit" runat="server"></asp:TextBox>
            </li>
            <li>
                <asp:Label ID="Label2" runat="server">Validation Type</asp:Label>
                <asp:DropDownList ID="ddlValidation" runat="server">
                    <asp:ListItem Value="0" Text="None" Selected="True" />
                    <asp:ListItem Value="1" Text="Required" />
                    <asp:ListItem Value="2" Text="Required and Decimal Only" />
                </asp:DropDownList>
            </li>
            <li>
                <asp:Label ID="Label4" runat="server">Order</asp:Label>
                <asp:TextBox ID="txtOrder" runat="server"></asp:TextBox>
            </li>
            <asp:UpdatePanel ID="DropdownUpdatePanel" runat="server">
                <ContentTemplate>
                    <div id="DropDown" runat="server" visible="false">
                        <asp:Panel ID="Panel1" runat="server" GroupingText="DrodDown Data">
                            <asp:Label ID="Label5" runat="server">Dropdown Value</asp:Label>
                            <asp:TextBox ID="txtValue" runat="server"></asp:TextBox>
                            <asp:Button ID="btnAdd" runat="server" Text="Add" OnClick="btnAdd_Click" />
                            <asp:GridView ID="grvDropDown" runat="server" AutoGenerateColumns="False" DataKeyNames="ID"
                                Font-Size="11px" BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px"
                                CellPadding="2" ForeColor="Black" GridLines="Vertical" Width="100%" CellSpacing="1"
                                OnRowDeleting="grvDropDown_RowDeleting" EmptyDataText="No Records Found!">
                                <AlternatingRowStyle BackColor="PaleGoldenrod"  />
                                <Columns>
                                    <asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" />
                                    <asp:BoundField DataField="Value" HeaderText="Value" SortExpression="Value" />
                                    <asp:TemplateField ShowHeader="False">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="deleteActionLinkButton" CausesValidation="false" CommandName="Delete"
                                                ToolTip="Delete" runat="server">
                  <div id="gridViewDeleteButton" >Delete </div>
                                            </asp:LinkButton>
                                            <%--OnClientClick="javascript:return confirm('Are you sure you want to delete this record?')"--%>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                <FooterStyle BackColor="Tan" />
                                <HeaderStyle BackColor="Tan" Font-Bold="True" />
                                <PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" HorizontalAlign="Center" />
                                <SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
                                <SortedAscendingCellStyle BackColor="#FAFAE7" />
                                <SortedAscendingHeaderStyle BackColor="#DAC09E" />
                                <SortedDescendingCellStyle BackColor="#E1DB9C" />
                                <SortedDescendingHeaderStyle BackColor="#C2A47B" />
                            </asp:GridView>
                        </asp:Panel>
                    </div>
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="ddlControl" EventName="SelectedIndexChanged" />
                </Triggers>
            </asp:UpdatePanel>
        </ol>
        
        <asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click" />
        </ContentTemplate>
        </asp:UpdatePanel>


        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:GridView ID="GWTestStructure" runat="server" AutoGenerateColumns="False" DataKeyNames="TestStructureId,TestId"
                    Font-Size="11px" BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px"
                    CellPadding="2" ForeColor="Black" GridLines="Vertical" Width="100%" 
                    CellSpacing="1" onrowdeleting="GWTestStructure_RowDeleting" 
                    EmptyDataText="No Records Found!" 
                  
                    onselectedindexchanged="GWTestStructure_SelectedIndexChanged" >
                    <AlternatingRowStyle BackColor="PaleGoldenrod" />
                    <Columns>
                        <asp:BoundField DataField="TestStructureText" HeaderText="Lable Name" SortExpression="TestStructureText" />
                        <asp:BoundField DataField="ControlId" HeaderText="ControlId" SortExpression="ControlId" />
                         <asp:BoundField DataField="Unit" HeaderText="Unit" SortExpression="Unit" />
                        <asp:BoundField DataField="TextOrder" HeaderText="TextOrder" SortExpression="TextOrder" />
                         <asp:BoundField DataField="ValidationId" HeaderText="ValidationId" SortExpression="ValidationId" Visible="false" />
                         <asp:BoundField DataField="TextOrder" HeaderText="TextOrder" SortExpression="TextOrder" Visible="false" />
                        <asp:CommandField  ShowCancelButton="False" 
                            ShowDeleteButton="True"  ShowHeader="True" />
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:LinkButton ID="LinkButton1" runat="server" Text="Edit" CommandName="Select"
                                   >
                                </asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>


                    </Columns>
                    <FooterStyle BackColor="Tan" />
                    <HeaderStyle BackColor="Tan" Font-Bold="True" />
                    <PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
                    <SortedAscendingCellStyle BackColor="#FAFAE7" />
                    <SortedAscendingHeaderStyle BackColor="#DAC09E" />
                    <SortedDescendingCellStyle BackColor="#E1DB9C" />
                    <SortedDescendingHeaderStyle BackColor="#C2A47B" />
                </asp:GridView>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="ddlTest" EventName="SelectedIndexChanged" />
            </Triggers>
        </asp:UpdatePanel>
    </fieldset>
</asp:Content>
